package com.its.common.disruptor.config;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author xiaxp
 * @Date 5/5/22 13:54
 * @Description
 */
@Data
@Slf4j
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class DisruptorConsumerProperties {
    private Integer workerNum;
    private String workerClass;

    public Class getWorkerClaz() {
        Class claz = null;
        try {
            claz = Class.forName(workerClass);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException("Disruptor消费者类文件找不到!");
        }
        return claz;
    }
}
